package com.da.message;

/**
 * User 消息对象
 *
 * @author da
 * @time 2024/7/3 下午 2:02
 */
public class UserMessage implements Message {
    private String role;
    private String content;

    /**
     * 指定角色的空参构造方法
     */
    public UserMessage() {
        this.role = "user";
    }

    /**
     * 构造函数
     *
     * @param content 消息内容
     */
    public UserMessage(String content) {
        this.role = "user";
        this.content = content;
    }

    public String getRole() {
        return role;
    }

    public void setRole(String role) {
        this.role = role;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    @Override
    public String toString() {
        return "{\"role\":\"" + role + "\",\"content\":\"" + content + "\"}";
    }
}
